#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 2610;
const int mod = 1e9+7;

int f[120][N];
char s[120];

void init(){
	f[0][0] = 1; int tot = 100 * 26;
	for(int i = 0;i < 100;i++){
		int res = 0;
		for(int j = i;j <= tot;j++){
			res += f[i][j]; if(j >= 26) res -= f[i][j - 26]; res %= mod; res += mod; res %= mod;
			f[i + 1][j + 1] = res;
		}
	}
}

void solve(){
	scanf("%s",s + 1);
	int tot = 0,ls = strlen(s+1); for(int i = 1;i <= ls;i++) tot += s[i] - 'a' + 1;
	printf("%d\n",(f[ls][tot] - 1 + mod) % mod);
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	int t = in; init();
	while(t--) solve();
	return 0;
}

